home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
blckade.exe
/
BLOCKADE.DOC
< prev
next >
Wrap
Text File
|
1992-10-23
|
27KB
|
991 lines
BLOCKADE (TM)
A self checker library for C programs
Copyright (C) 1991,92 Indusoft Corp.
Indusoft Corp.
PO. Box 26747
Greenville, SC 29616-1747
Blockade, (C) Copyright 1991-92 Indusoft Corp. page -1-
OVERVIEW
Blockade is a function library for C programmers which allows
your C programs to protect themselves against unauthorized
changes. Virus protection IMMEDIATELY comes to mind as its main
use, but there are more.
I wrote BLOCKADE so that programs I wrote could check
themselves. Have you had those times too? Those unexplainable
times when a program runs but has some odd behavior that makes
you suspect corruption, virus related or not.
This happened to me when I was checking out a disk caching
utility. Files I had compiled and linked often quit running
after copying them to another disk or subdirectory. The
combination of controller, BIOS, and cache software was
causing just a few bytes of a file to be altered anytime I
copied it (and of course without warning or notice).
After several hours of searching, I found the problem and
looked for a way to make my programs self checking. The result
was BLOCKADE.
BLOCKADE checks every byte of your EXE or COM to insure that
changes are detected. Its algorithm is designed to be effective
but fast enough allow use in your programs.
I also use BLOCKADE in my products to protect against
unauthorized patches to my programs and to protect my
customers from running versions of the program damaged
unintentionally.
Blockade is easy to use. 1 major function analyses your EXE
file and returns a status code indicating whether your file has
been altered.
Blockade, (C) Copyright 1991-92 Indusoft Corp. page -2-
NEAT FEATURES
* Fast operation. A 40k EXE file can check itself in less
than 3 seconds on a 12 MHZ AT.
* Ease of use. A few #includes and only a handful
of additions are needed to use BLOCKADE. No changes to
your program's basic structure are necessary.
* Ability to add user data to a program "skeleton".
useful for adding customer names and serial numbers.
* Expandable. BLOCKADE can be modified to extend the
number and type checking methods you use.
The source code to BLOCKADE is available, allowing you to
create new checking methods unique to your application.
THEORY OF OPERATION
Blockade works via 2 pieces of code you add to your program.
(1) A special data structure "SIGNATUR.H", which is #include'd
in your program. The structure reserves room for the
information BLOCKADE will need to analyze your program.
(2) The function blockade(), which checks your program for
alteration.
After linking, a special program (BRAND.EXE) is run to find the
special string included by "SIGNATUR.H" in the data area of
your EXE file, calculate the checking information and overwrite
that area with the data blockade() needs to detect changes to
your file. Once branded, your program can check itself for
changes each time it is run.
Blockade, (C) Copyright 1991-92 Indusoft Corp. page -3-
I HAVE TO RUN BRAND.EXE EACH TIME I RELINK MY APPLICATION ?
That's the problem I had with other products similar to
BLOCKADE. The biggest headache was time - it seemed to take
forever for them to calculate and update my program.
To combat that, ALOT of time went into the all the utilities to
make things FAST. For example, on an 8 MHz AT, the Brand
utility will analyze and brand a 40 K .EXE file in less than 4
seconds.
The same thing is true for your developed applications. Nobody
wants to wait 30-40 seconds every time they start your program
while it self checks. The check algorithm in BLOCKADE is quick.
Running from a hard disk, I doubt anyone will notice the delay.
I leave the BLOCKADE code linked in during development - to
take into account the effect it has on speed and memory use -
but have the program ignore any error codes until my final
production link.
Blockade, (C) Copyright 1991-92 Indusoft Corp. page -4-
CONTENTS
This self extracting file should contain at least the following files:
blkade1.c - the error message function used by BLOCKADE.
blkdmoms.lib - Blockade demo library Microsoft 5.1 (Small model)
blkdmoml.lib - Blockade demo library Microsoft 5.1 (Large model)
blkdmots.lib - Blockade demo library Turbo C 2.01 (Small model)
blkdmotl.lib - Blockade demo library Turbo C 2.01 (Large model)
blkdmobs.lib - Blockade demo library Borland C++ 2.0 (Small model)
blkdmobl.lib - Blockade demo library Borland C++ 2.0 (Large model)
brand.exe - calculates your program's checkcode data
and "brands" it into your .EXE file.
demo.c - Demonstrates use of the Blockade function library.
demo.exe - Demo program demonstrating BLOCKADE's use.
demo.mak - Microsoft C make file for DEMO.EXE.
rundemo.bat - Demonstrates use of the Blockade system.
mksig.exe - Generates a SIGNATUR.H file.
signatur.h - include file to be embedded in your program.
blkproto.h - function prototypes for blockade functions.
userdata.dat - a sample user data file used with DEMO.EXE.
read.me - any last minute info.
The file BLKDEMO.PAK is an ASCII file listing the exact files
in this distribution.
COMPILER'S SUPPORTED
The test drive of BLOCKADE version comes with libraries for
Turbo C 2.0, Borland C++ 2.0 and Microsoft C 5.x. I don't know
if these are usable with Microsoft 6.0. According to Borland,
the C++ libraries are NOT reliably usable with Turbo C 2.0.
However, Turbo C++ and Borland C++ libraries do seem to be
compatible.
For now, folks with other C compilers must license the source
code and compile it themselves. BLOCKADE and all it's support
programs are written in (almost) ANSI C so things should
compile up just fine.
The libraries were compiled with the following options.
For TC : tc -O -G -c -ml(or s)
For BCC : bcc -O -G -c -ml(or s)
For MSC : CL /W3 /Ox /Zi /c /AL(or S)
Blockade, (C) Copyright 1991-92 Indusoft Corp. page -5-
Below is an short program illustrating the BLOCKADE system.
(This is in fact a section of the DEMO program included in your
BLOCKADE package)